import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class Account {
    private final int id;
    private int amount;
    private final Lock lock = new ReentrantLock();
    //-----------------------------------------------------------------
    public Account(int id, int amount) {
        this.id = id;
        this.amount = amount;
    }
    public Account(int id) {
        this(id, 0);
    }
    //-----------------------------------------------------------------
    public void withdraw(int amount){
        this.amount -= amount;
    }
    //-----------------------------------------------------------------
    public void deposit(int amount){
        this.amount += amount;
    }
    //-----------------------------------------------------------------
    public int getId() {
        return id;
    }
    public int getAmount() {
        return amount;
    }
    public Lock getLock() {
        return lock;
    }
    //------------------------------------------------------------------
}
